package com.forest.gissingle.utils;

import java.util.ArrayList;

import com.forest.gissingle.bean.LatBean;
import com.forest.gissingle.bean.SqlDataBean;

/**
 * bean转化成sb
 * 
 * @author df_wind
 * 
 */
public class BeanToString {
	/**
	 * 转化SqlDataBean成现实的文字
	 * 
	 * @param sqlBean
	 * @return
	 */
	public static StringBuilder showSqlBean(SqlDataBean sqlBean) {
		StringBuilder sb = new StringBuilder();
		sb.append("Region=");
		sb.append(sqlBean.getRegion());
		sb.append("\n");
		sb.append("number=");
		sb.append(sqlBean.getNumber());
		sb.append("\n");
		sb.append("getSqrtString=");
		sb.append(sqlBean.getSqrtString());
		sb.append("\n");
		sb.append("getMarkString=");
		sb.append(sqlBean.getMarkString());
		sb.append("\n");
		sb.append("getOtherString1=");
		sb.append(sqlBean.getOtherString1());
		sb.append("\n");
		sb.append("getOtherString2=");
		sb.append(sqlBean.getOtherString2());
		sb.append("\n");
		try {
			sb.append("Center:");
			sb.append("lat=" + sqlBean.getCenter().getLatitude() + "long="
					+ sqlBean.getCenter().getLongitude());
			sb.append("\n");
		} catch (Exception e) {
			sb = new StringBuilder();
			return sb.append("Center无数值");
		}

		ArrayList<LatBean> lats = sqlBean.getLats();
		sb.append("lats:\n");
		for (LatBean latBean : lats) {
			sb.append("lat=" + latBean.getLatitude() + "long="
					+ latBean.getLongitude());
			sb.append("\n");
		}
		return sb;
	}
}
